package gin_handler

import (
	web_constants "app/app_src/framework/constant/web"
	"app/app_src/framework/i18n"

	"github.com/gin-gonic/gin"
)

func CurrentLanguageHandler(c *gin.Context) {
	langCode, err := c.Cookie(web_constants.COOKIE_LANG_CODE)

	if err != nil {
		return
	}

	i18n.SetCurrentLanguage(langCode)
}
